cmake_minimum_required(VERSION 3.0)

project(SyyGather LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_VERBOSE_MAKEFILE ON)

set(CMAKE_CXX_FLAGS_DEBUG "-O0 ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS "-Werror=return-type ${CMAKE_CXX_FLAGS}")

set(CMAKE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})

if (${PLATFORM} MATCHES "powereuler")
    add_definitions(-DPLATFORM_NUM=3)
    set(CMAKE_C_COMPILER  aarch64-powereuler-linux-gcc)
    set(CMAKE_CXX_COMPILER aarch64-powereuler-linux-g++)
    set(PLATFORM_LINK_DIR ${CMAKE_ROOT_DIR}/thirdparty/platform/powereuler)
    include_directories(${CMAKE_ROOT_DIR}/thirdparty/platform/powereuler)
else()
    error("please set platform [powereuler]")
endif()
add_compile_options(-fPIC)

include_directories(${CMAKE_ROOT_DIR})
include_directories(${CMAKE_ROOT_DIR}/inc)
include_directories(${CMAKE_ROOT_DIR}/lib/com)
include_directories(${CMAKE_ROOT_DIR}/thirdparty)
add_subdirectory(thirdparty)
add_subdirectory(src)
add_subdirectory(plugin)
add_subdirectory(lib)

set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/SyyGather")